﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Dune2013
{
    public class RecargarBehavior : Behavior
    {
        public float velocidadCargaNafta;// = 1;
        public RecargarBehavior(float velocidadCargaNafta) :
            base(){
                this.velocidadCargaNafta = velocidadCargaNafta;
                typeBehavior = TypeBehavior.Trabajo;
            }
        public override void execute(int dTime, Actor act)
        {
            if (act is Recolector) {
                Recolector rec = (Recolector)act;
                rec.nafta += velocidadCargaNafta;
                if (rec.nafta >= rec.maxNafta)
                {
                    rec.nafta = rec.maxNafta;
                    act.resumeBehavior();
                }
            }
            base.execute(dTime, act);
        }
        public override void enter(Actor act)
        {
            //act.position = new Vector2(-300, -300);
            //System.Console.WriteLine("empece a regar");
            //act.velocity = Vector2.Zero;
            act.speed = 0;
            base.enter(act);
        }
        public override void exit(Actor act)
        {
            base.exit(act);
        }
        public override Behavior getIrABehavior()
        {
            return null; //no deberia darse este caso
        }
    }
}
